package com.project.service.impl;

import java.util.List;
import java.util.Map;

import com.project.entity.ActualResults;
import com.project.mapper.ActualResultsMapper;
import com.project.service.MidCheck;

public class MidCheckService implements MidCheck {

	private ActualResultsMapper	actualResultsMapper;
	
	
	
	
	
	
	
	public ActualResultsMapper getActualResultsMapper() {
		return actualResultsMapper;
	}

	public void setActualResultsMapper(ActualResultsMapper actualResultsMapper) {
		this.actualResultsMapper = actualResultsMapper;
	}

	
	
	
	
	
	
	
	
	/***
	 * Map里包括 项目编号 以及start，limit
	 */
	public List<ActualResults> getAllResult(Map<String, String> map) {
		// TODO Auto-generated method stub
		return this.actualResultsMapper.getAllResult(map);
	}
	/**
	 * Map包括项目编号
	 */
	public ActualResults getResult(Map<String, String> map) {
		// TODO Auto-generated method stub
		ActualResults result  = this.actualResultsMapper.getResult(map);
		return result;
	}

	/**
	 * Map包含向项目编号
	 */
	public int getResultCount(Map<String, String> map) {
		// TODO Auto-generated method stub
		int i;
		try{
			i = this.actualResultsMapper.getResultCount(map);
		}catch(Exception e){
			i = -1;
			e.printStackTrace();
		}
		return i;
	}

	
	/**
	 * 
	 */
	public int updateResult(ActualResults result) {
		// TODO Auto-generated method stub
		int i;
		try{
			i = this.actualResultsMapper.updateResult(result);
		}catch(Exception e){
			i = -1;
			e.printStackTrace();
		}
		return i;
	}

	public ActualResults getById(int id) {
		// TODO Auto-generated method stub
		return  this.actualResultsMapper.selectByPrimaryKey(id);
	}

}
